/*
 * ROM contents of К145ИК1303 serial arithmetic processor.
 * Using data from emu145 project by Felix Lazarev:
 * https://code.google.com/p/emu145/
 */
static const unsigned int ik1303_ucmd_rom[] = {
    0x0000000, 0x0800001, 0x0040020, 0x1440090,
    0x0A00081, 0x1000000, 0x1400020, 0x0800008,
    0x0A03180, 0x1002200, 0x0800400, 0x1418001,
    0x0080020, 0x0841020, 0x0203100, 0x0203088,
    0x0A00820, 0x0800120, 0x08001C0, 0x0810081,
    0x0A00089, 0x0800401, 0x0A010A0, 0x0A01081,
    0x0818001, 0x1A00220, 0x0201100, 0x0203420,
    0x0008000, 0x0801020, 0x0201420, 0x0801190,
    0x0040000, 0x0080820, 0x0800002, 0x0140002,
    0x0800100, 0x0A03C20, 0x0A00808, 0x0A01008,
    0x0200540, 0x0601209, 0x0083100, 0x0A03081,
    0x8800004, 0x0058001, 0x1001280, 0x1008001,
    0x1200209, 0x4018001, 0x0040002, 0x1000001,
    0x0010200, 0x0800840, 0x0A01181, 0x4018801,
    0x0A10181, 0x0800801, 0x0040001, 0x0011190,
    0x0858001, 0x0040020, 0x3200209, 0x08000C0,
    0x4000020, 0x0600081, 0x1000000, 0x1000180,
};

static const unsigned int ik1303_cmd_rom[256] = {
    0x00386050, 0x005B3F3E, 0x000F5970, 0x00152470,
    0x000C3D50, 0x0011312F, 0x005B4544, 0x00165050,
    0x000C3404, 0x005B3F3E, 0x00D40450, 0x00162424,
    0x000C4962, 0x01FB5250, 0x000D4924, 0x01BB2222,
    0x00155050, 0x010F5247, 0x00182525, 0x00080505,
    0x000E041E, 0x00123433, 0x007F6425, 0x007F0D25,
    0x01650950, 0x01176553, 0x007E2432, 0x00087150,
    0x007E2455, 0x00135076, 0x00085977, 0x005B4544,
    0x000C2E26, 0x00310D2E, 0x00100E35, 0x00316B47,
    0x01381250, 0x0011302E, 0x01385F50, 0x00050250,
    0x011C0101, 0x00195050, 0x00382C2C, 0x016F2222,
    0x013A2222, 0x002F6B56, 0x00093D6C, 0x00F04D50,
    0x000C1750, 0x00074A50, 0x01B45047, 0x003C2020,
    0x01AA2B6A, 0x00123432, 0x001D4933, 0x0113500C,
    0x00052556, 0x00087C50, 0x01130000, 0x00142B2B,
    0x004A1D50, 0x006E5756, 0x00496050, 0x00E57D58,
    0x011E5D22, 0x01F35F50, 0x00EA0505, 0x001C7A50,
    0x01080B50, 0x0054244B, 0x000C4050, 0x002A2121,
    0x00135C5C, 0x000A4650, 0x00152504, 0x009D2B60,
    0x00064350, 0x00192020, 0x00292C2C, 0x01235C50,
    0x006D3C3C, 0x0031017D, 0x00092D2D, 0x004E2D2D,
    0x01596A7E, 0x00E3396E, 0x006E3654, 0x016E6E47,
    0x00534950, 0x00EE2062, 0x0016226E, 0x00660525,
    0x00135C5C, 0x000A4241, 0x00383B3B, 0x000C7277,
    0x00360404, 0x00042020, 0x00100A2E, 0x00155050,
    0x00532404, 0x0004642B, 0x01843C47, 0x01A35047,
    0x01847250, 0x015C112F, 0x00080434, 0x00152F23,
    0x00080505, 0x00906047, 0x0113150C, 0x006D2224,
    0x00747250, 0x000C632B, 0x00AD672B, 0x000A612E,
    0x01B97463, 0x00417374, 0x00BD0658, 0x00EA2450,
    0x00087166, 0x01BD3950, 0x001A2E50, 0x00BD6047,
    0x00175079, 0x005E6035, 0x000A3847, 0x01067F47,
    0x008C5251, 0x0013612E, 0x0087602E, 0x005B3F3E,
    0x00DC2121, 0x00177374, 0x00182525, 0x00286050,
    0x00064F4E, 0x000C5251, 0x006E2926, 0x008F602F,
    0x008C502A, 0x00172928, 0x00814F4E, 0x003F534B,
    0x000F075B, 0x00082525, 0x01E85047, 0x00790505,
    0x00152F23, 0x0017506A, 0x00095047, 0x00082525,
    0x00E63A62, 0x00DA0B47, 0x01174150, 0x00182525,
    0x00090450, 0x01175B50, 0x00094850, 0x001B2F50,
    0x00806047, 0x000A3720, 0x0010382F, 0x002C0505,
    0x009B5021, 0x00160505, 0x01ED3A50, 0x00040505,
    0x00082525, 0x01080F50, 0x01B35047, 0x000D3D4C,
    0x00180404, 0x01C03A50, 0x00E20421, 0x00287B50,
    0x00097F26, 0x0013612E, 0x01B6112F, 0x00322425,
    0x01B81847, 0x00BA714B, 0x00182450, 0x00080505,
    0x00182525, 0x004F1D24, 0x00736F5C, 0x00A67569,
    0x00AD2726, 0x01BE5022, 0x000A5E04, 0x00173A62,
    0x00CB752E, 0x00B11E25, 0x00CB0953, 0x00085068,
    0x002B2020, 0x01984150, 0x00C77C04, 0x00DA0950,
    0x00160404, 0x00F56040, 0x00DE0450, 0x01CB1160,
    0x00CF4950, 0x000A4747, 0x001F210B, 0x00145050,
    0x01171050, 0x00052075, 0x001D3D37, 0x00365555,
    0x00130101, 0x01D57424, 0x00D66047, 0x01C47850,
    0x004D2C2C, 0x01174150, 0x00174847, 0x00C90350,
    0x000A2760, 0x0019502E, 0x00D72C2C, 0x01174850,
    0x006C224B, 0x000A495B, 0x00100E35, 0x00312104,
    0x01C00850, 0x00115A2F, 0x00EA0505, 0x00080574,
    0x00152F23, 0x005C6050, 0x01C94122, 0x01A42222,
    0x00DF2847, 0x00C9202E, 0x00A76047, 0x0117502F,
    0x002E2020, 0x01205048, 0x00F8606D, 0x002D604C,
    0x00443A62, 0x000D3D2E, 0x015C3950, 0x01625022,
    0x006E136E, 0x0031602E, 0x01085D1A, 0x010F6F50,
    0x0017506A, 0x00FB5020, 0x000A3C47, 0x00174D50,
};

static const unsigned char ik1303_prog_rom[128*9] = {
    0x2C, 0x23, 0x00, 0x2C, 0x23, 0x00, 0x2C, 0x23, 0x30,
    0x31, 0x32, 0x00, 0x31, 0x32, 0x12, 0x31, 0x32, 0x30,
    0x00, 0x00, 0x00, 0x11, 0x23, 0x00, 0x1F, 0x06, 0x00,
    0x31, 0x00, 0x1C, 0x31, 0x00, 0x00, 0x31, 0x08, 0x1D,
    0x2C, 0x02, 0x0E, 0x2C, 0x02, 0x01, 0x2C, 0x02, 0x08,
    0x08, 0x3A, 0x00, 0x00, 0x3A, 0x01, 0x05, 0x3A, 0x11,
    0x18, 0x0A, 0x2B, 0x00, 0x01, 0x33, 0x02, 0x24, 0x25,
    0x37, 0x3A, 0x18, 0x31, 0x3A, 0x1F, 0x31, 0x3A, 0x3D,
    0x37, 0x02, 0x06, 0x31, 0x02, 0x12, 0x31, 0x10, 0x19,
    0x39, 0x02, 0x26, 0x33, 0x09, 0x08, 0x19, 0x19, 0x08,
    0x01, 0x14, 0x0C, 0x00, 0x00, 0x00, 0x1B, 0x06, 0x01,
    0x26, 0x00, 0x21, 0x12, 0x14, 0x24, 0x06, 0x12, 0x00,
    0x39, 0x00, 0x21, 0x08, 0x22, 0x00, 0x10, 0x14, 0x00,
    0x20, 0x00, 0x00, 0x39, 0x02, 0x00, 0x06, 0x25, 0x25,
    0x19, 0x02, 0x16, 0x09, 0x11, 0x19, 0x16, 0x11, 0x13,
    0x18, 0x08, 0x10, 0x18, 0x00, 0x01, 0x1F, 0x06, 0x12,
    0x1A, 0x12, 0x2E, 0x19, 0x02, 0x00, 0x33, 0x38, 0x00,
    0x0D, 0x06, 0x3B, 0x13, 0x0A, 0x02, 0x00, 0x27, 0x00,
    0x00, 0x00, 0x33, 0x13, 0x3C, 0x00, 0x11, 0x14, 0x04,
    0x11, 0x1D, 0x34, 0x13, 0x01, 0x00, 0x14, 0x27, 0x00,
    0x2C, 0x10, 0x21, 0x2C, 0x02, 0x33, 0x00, 0x00, 0x00,
    0x37, 0x12, 0x2A, 0x31, 0x02, 0x00, 0x12, 0x06, 0x09,
    0x37, 0x12, 0x2A, 0x31, 0x14, 0x0C, 0x00, 0x00, 0x00,
    0x39, 0x0D, 0x12, 0x10, 0x0F, 0x00, 0x00, 0x27, 0x03,
    0x37, 0x12, 0x0C, 0x31, 0x05, 0x00, 0x31, 0x00, 0x00,
    0x37, 0x20, 0x0A, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x11, 0x13, 0x0E, 0x01, 0x0D, 0x11, 0x05, 0x25, 0x24,
    0x0A, 0x24, 0x0C, 0x08, 0x0D, 0x21, 0x00, 0x00, 0x00,
    0x37, 0x06, 0x3A, 0x31, 0x05, 0x02, 0x0A, 0x1D, 0x16,
    0x38, 0x14, 0x0C, 0x00, 0x08, 0x06, 0x20, 0x1B, 0x34,
    0x0E, 0x02, 0x06, 0x00, 0x02, 0x1F, 0x19, 0x20, 0x08,
    0x37, 0x10, 0x21, 0x31, 0x12, 0x0C, 0x00, 0x00, 0x00,
    0x01, 0x2D, 0x30, 0x01, 0x2D, 0x00, 0x01, 0x2D, 0x30,
    0x33, 0x34, 0x06, 0x01, 0x18, 0x00, 0x01, 0x18, 0x08,
    0x31, 0x20, 0x34, 0x31, 0x20, 0x05, 0x31, 0x20, 0x08,
    0x1F, 0x3A, 0x20, 0x14, 0x3A, 0x20, 0x0C, 0x00, 0x20,
    0x0A, 0x20, 0x06, 0x30, 0x1F, 0x0C, 0x00, 0x20, 0x00,
    0x35, 0x20, 0x05, 0x34, 0x14, 0x09, 0x30, 0x20, 0x11,
    0x08, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x33, 0x20,
    0x04, 0x16, 0x06, 0x36, 0x06, 0x0C, 0x01, 0x03, 0x00,
    0x2F, 0x08, 0x18, 0x1C, 0x00, 0x18, 0x00, 0x20, 0x18,
    0x00, 0x18, 0x14, 0x35, 0x1D, 0x06, 0x14, 0x00, 0x3B,
    0x06, 0x20, 0x05, 0x34, 0x14, 0x09, 0x19, 0x00, 0x21,
    0x05, 0x3A, 0x3A, 0x06, 0x3A, 0x3A, 0x05, 0x3A, 0x3A,
    0x01, 0x23, 0x00, 0x01, 0x23, 0x00, 0x01, 0x23, 0x08,
    0x01, 0x32, 0x02, 0x01, 0x32, 0x02, 0x01, 0x32, 0x02,
    0x15, 0x04, 0x03, 0x15, 0x17, 0x03, 0x15, 0x17, 0x03,
    0x07, 0x2B, 0x03, 0x07, 0x17, 0x03, 0x07, 0x17, 0x03,
    0x04, 0x1E, 0x06, 0x1E, 0x3F, 0x0E, 0x09, 0x11, 0x13,
    0x0F, 0x29, 0x05, 0x09, 0x28, 0x09, 0x09, 0x09, 0x01,
    0x08, 0x0B, 0x0B, 0x1B, 0x0B, 0x0B, 0x1E, 0x0B, 0x00,
    0x08, 0x0B, 0x0B, 0x0E, 0x0B, 0x0B, 0x1A, 0x0B, 0x00,
    0x11, 0x1D, 0x06, 0x08, 0x10, 0x04, 0x02, 0x06, 0x2F,
    0x1F, 0x1C, 0x2F, 0x00, 0x1C, 0x1C, 0x09, 0x18, 0x11,
    0x0B, 0x0C, 0x0C, 0x0B, 0x02, 0x30, 0x00, 0x00, 0x00,
    0x25, 0x1C, 0x04, 0x01, 0x1C, 0x1D, 0x1D, 0x06, 0x08,
    0x01, 0x30, 0x21, 0x3F, 0x2E, 0x11, 0x19, 0x25, 0x01,
    0x16, 0x00, 0x00, 0x03, 0x0C, 0x0A, 0x19, 0x0A, 0x19,
    0x0E, 0x16, 0x1B, 0x11, 0x1D, 0x10, 0x3C, 0x3A, 0x05,
    0x20, 0x08, 0x10, 0x06, 0x22, 0x19, 0x02, 0x22, 0x18,
    0x06, 0x0C, 0x01, 0x10, 0x00, 0x00, 0x00, 0x11, 0x13,
    0x0A, 0x2B, 0x03, 0x0A, 0x17, 0x03, 0x0A, 0x17, 0x03,
    0x12, 0x14, 0x06, 0x12, 0x02, 0x00, 0x0A, 0x02, 0x00,
    0x0A, 0x24, 0x0C, 0x00, 0x0A, 0x21, 0x06, 0x20, 0x18,
    0x0A, 0x21, 0x21, 0x35, 0x02, 0x08, 0x10, 0x02, 0x05,
    0x00, 0x12, 0x0F, 0x11, 0x24, 0x21, 0x35, 0x02, 0x05,
    0x06, 0x25, 0x0C, 0x06, 0x02, 0x12, 0x14, 0x02, 0x18,
    0x12, 0x20, 0x14, 0x00, 0x00, 0x21, 0x18, 0x12, 0x0B,
    0x0A, 0x24, 0x06, 0x00, 0x20, 0x08, 0x25, 0x02, 0x00,
    0x24, 0x02, 0x35, 0x18, 0x12, 0x14, 0x34, 0x00, 0x18,
    0x12, 0x14, 0x0C, 0x00, 0x0A, 0x21, 0x35, 0x02, 0x00,
    0x00, 0x26, 0x03, 0x06, 0x27, 0x03, 0x06, 0x27, 0x03,
    0x26, 0x03, 0x00, 0x27, 0x03, 0x00, 0x27, 0x03, 0x00,
    0x11, 0x04, 0x03, 0x00, 0x36, 0x03, 0x00, 0x36, 0x03,
    0x06, 0x04, 0x03, 0x07, 0x17, 0x03, 0x07, 0x17, 0x03,
    0x0A, 0x20, 0x24, 0x25, 0x03, 0x06, 0x08, 0x02, 0x0B,
    0x12, 0x04, 0x16, 0x0A, 0x17, 0x03, 0x0A, 0x17, 0x03,
    0x07, 0x2B, 0x00, 0x07, 0x17, 0x00, 0x07, 0x17, 0x25,
    0x00, 0x07, 0x2B, 0x03, 0x07, 0x17, 0x03, 0x07, 0x17,
    0x03, 0x36, 0x03, 0x11, 0x24, 0x1D, 0x24, 0x03, 0x06,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x15, 0x04, 0x03, 0x15, 0x17, 0x03, 0x15, 0x17,
    0x03, 0x12, 0x1D, 0x1D, 0x14, 0x06, 0x12, 0x06, 0x00,
    0x1C, 0x1C, 0x00, 0x1C, 0x2F, 0x00, 0x06, 0x20, 0x20,
    0x00, 0x0B, 0x02, 0x00, 0x0B, 0x02, 0x00, 0x36, 0x00,
    0x01, 0x18, 0x18, 0x01, 0x18, 0x18, 0x01, 0x18, 0x18,
    0x00, 0x00, 0x00, 0x33, 0x00, 0x08, 0x18, 0x04, 0x28,
    0x1F, 0x0C, 0x08, 0x25, 0x06, 0x0E, 0x06, 0x00, 0x18,
    0x06, 0x0E, 0x00, 0x16, 0x16, 0x00, 0x1D, 0x20, 0x20,
    0x18, 0x07, 0x06, 0x35, 0x10, 0x34, 0x05, 0x09, 0x24,
    0x05, 0x09, 0x09, 0x09, 0x09, 0x01, 0x0D, 0x10, 0x09,
    0x08, 0x25, 0x33, 0x2E, 0x06, 0x1B, 0x06, 0x00, 0x13,
    0x1C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x1C, 0x00, 0x38,
    0x1D, 0x3D, 0x05, 0x1D, 0x3D, 0x05, 0x1D, 0x3D, 0x05,
    0x1D, 0x20, 0x1D, 0x00, 0x18, 0x00, 0x33, 0x34, 0x06,
    0x39, 0x3C, 0x21, 0x01, 0x3C, 0x01, 0x06, 0x1F, 0x19,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
    0x0A, 0x17, 0x03, 0x11, 0x13, 0x14, 0x00, 0x05, 0x35,
    0x00, 0x05, 0x34, 0x00, 0x00, 0x34, 0x00, 0x00, 0x34,
    0x38, 0x04, 0x02, 0x33, 0x00, 0x11, 0x04, 0x00, 0x00,
    0x0C, 0x00, 0x26, 0x33, 0x09, 0x09, 0x20, 0x08, 0x18,
    0x0F, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x05,
    0x30, 0x09, 0x20, 0x20, 0x06, 0x20, 0x21, 0x00, 0x00,
    0x0A, 0x3A, 0x10, 0x2B, 0x18, 0x38, 0x38, 0x0E, 0x02,
    0x16, 0x0C, 0x35, 0x05, 0x00, 0x00, 0x19, 0x30, 0x00,
    0x08, 0x1C, 0x18, 0x00, 0x1C, 0x00, 0x00, 0x05, 0x3A,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20,
    0x1F, 0x0C, 0x08, 0x25, 0x06, 0x08, 0x00, 0x00, 0x34,
    0x06, 0x1C, 0x05, 0x25, 0x1C, 0x25, 0x1F, 0x18, 0x34,
    0x33, 0x20, 0x26, 0x0B, 0x02, 0x00, 0x34, 0x09, 0x09,
    0x00, 0x06, 0x36, 0x00, 0x00, 0x11, 0x24, 0x0B, 0x34,
    0x20, 0x20, 0x00, 0x00, 0x39, 0x02, 0x08, 0x1D, 0x00,
    0x00, 0x08, 0x00, 0x3E, 0x00, 0x00, 0x37, 0x08, 0x1D,
    0x00, 0x00, 0x20, 0x00, 0x35, 0x20, 0x05, 0x34, 0x34,
    0x12, 0x14, 0x24, 0x34, 0x2E, 0x30, 0x1F, 0x06, 0x08,
    0x01, 0x05, 0x30, 0x04, 0x30, 0x2E, 0x06, 0x0E, 0x00,
    0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x34, 0x00,
    0x0A, 0x06, 0x1B, 0x1F, 0x00, 0x00, 0x25, 0x00, 0x3B,
    0x25, 0x10, 0x06, 0x00, 0x00, 0x0A, 0x10, 0x07, 0x03,
    0x0A, 0x10, 0x01, 0x00, 0x00, 0x00, 0x16, 0x19, 0x35,
    0x06, 0x12, 0x10, 0x19, 0x10, 0x00, 0x00, 0x00, 0x3A,
    0x11, 0x06, 0x09, 0x35, 0x16, 0x10, 0x3E, 0x13, 0x0D,
    0x24, 0x3D, 0x10, 0x0E, 0x12, 0x33, 0x03, 0x06, 0x30,
    0x00, 0x26, 0x00, 0x00, 0x27, 0x00, 0x00, 0x3B, 0x08,
    0x06, 0x0C, 0x0C, 0x20, 0x0A, 0x06, 0x11, 0x14, 0x00,
    0x18, 0x24, 0x06, 0x0A, 0x10, 0x18, 0x11, 0x24, 0x18,
    0x10, 0x25, 0x05, 0x06, 0x3C, 0x05, 0x06, 0x00, 0x00,
    0x06, 0x0C, 0x0C, 0x00, 0x00, 0x12, 0x24, 0x1D, 0x1D,
};
